home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / code / contr / setup.exe / Disk1 / data1.cab / Configuration_En / Commands / ccImageOptions.js < prev    next >
Encoding:
JavaScript  |  2003-07-18  |  2.1 KB  |  95 lines

  1. //
  2. // Copyright 1999, 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  3. // ----------------------------------------------------
  4. //
  5. // Accessibility.js
  6. //
  7. // This command adds 
  8. // 
  9. //
  10. // Version 1.0
  11. // Added functions...
  12. // ----------------------------------------------------
  13.  
  14. var helpDoc = MM.HELP_objCCImageAccessOptions;
  15. var golbalFormItem;
  16. var returnTag='';
  17. var isCanceled=false;
  18.  
  19. function isDOMRequired() { 
  20.     // Return false, indicating that this object is available in code view.
  21.     return false;
  22. }
  23.  
  24. function commandButtons(){
  25.     return new Array(    "PutButtonsOnBottom", 
  26.                         "OkButton", MM.BTN_OK, "if (setImageStr()) {isCanceled=false; window.close();}",
  27.                         "CancelButton", MM.BTN_Cancel, "isCanceled=true; window.close();",
  28.                          "PutButtonOnLeft", MM.BTN_Help,    "displayHelp()");
  29.           
  30.  
  31. }
  32.  
  33. function setFormItem(formItem) {
  34.     globalFormItem = formItem;
  35.     returnTag = globalFormItem;
  36. }
  37.  
  38. function setImageStr()
  39. {
  40.     var rtnStr='';
  41.  
  42.  
  43.     rtnStr= globalFormItem;
  44.  
  45.  
  46. ////////////////////////////////////////////////////////////////
  47. // Attributes: Compose rtnStr with the attributes that have a value
  48. // Possible attributes are: alt and longdesc
  49.  
  50.  
  51. // if 'alt attribute' has a value, apply it to the initStr
  52.  
  53.     altValue=document.forms[0].alt.value;
  54.     if ((altValue == null) || (altValue == "") )
  55.     {
  56.         var alertString = dw.loadString ("ccImageOptions/altText");
  57.         alert (alertString);
  58.         return false;
  59.     }
  60.     rtnStr= addAttribute("alt", altValue, rtnStr);
  61.     returnTag= rtnStr;
  62.     return true;
  63. }
  64.  
  65. function returnAccessibilityStr () 
  66. {
  67.     if (isCanceled) 
  68.         return "";
  69.     return returnTag;
  70. }
  71.  
  72. ///////////////////////////////////////////////////////////////
  73. // other functions
  74. //////////////////////////////////////////////////////////////
  75.  
  76.  
  77. function addAttribute(tagName, tagVal, initStr){
  78.  
  79.     arrayElem= initStr.split(">");
  80.     rtnStr= arrayElem[0] + " " + tagName + "=" + '\"' + tagVal + '\"' + ">" + arrayElem[1];
  81.     
  82.     return rtnStr;
  83. }
  84.  
  85.  
  86. function getImageSrc(tagStr){
  87.  
  88.     arrayElements= tagStr.split("src=\"");
  89.     arrayStrings=  arrayElements[1].split("\"");
  90.     src= arrayStrings[0];
  91.     return src;
  92. }
  93.  
  94.  
  95.